<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <father></father>
    </div>
    <template id="father">
        <div>
            <h1>我是父标题</h1>
        </div>
    </template>
</body>
<script src="../js/http_cdn.bootcdn.net_ajax_libs_vue_2.6.6_vue.js"></script>
<script>
    const sonCpn = {
        template: ` <div>
                        <h3>
                            我是子组件标题
                        </h3>
                    </div>`,
    }

    const fatherCpn = {
        template: ` <div>
                        <h1>
                            <sonCpn></sonCpn>
                            <h1>我是父组件标题</h1>
                        </h1>
                    </div>`,
        components: {
            sonCpn: sonCpn
        }
    }
    Vue.component('father',fatherCpn)

    new Vue({
        el: "#app",
        data: {
            msg: '你好'
        },
    })

</script>

</html>
